import base.Human01;
import base.People;

import java.text.DecimalFormat;
import java.util.ArrayList;
import java.util.List;

public class Main {
    public static void main(String[] args) {
//        System.out.println("Hello world!");

        Human01 chapter01 = new Human01();
        People zhnagsan = new People();
        zhnagsan.setName("张三");
        zhnagsan.setAge(19);
        zhnagsan.setAdress("陡山河");
        zhnagsan.setHeight(1.8);
        zhnagsan.setSex("男");
        People lisi = new People();
        lisi.setName("李四");
        lisi.setAge(18);
        lisi.setAdress("西奈");
        lisi.setHeight(1.75);
        lisi.setSex("男");
        System.out.println(zhnagsan.introduce());
        System.out.println(lisi.introduce());
        People wangwu= new People("王五","女",20,"北京",1.9);
        System.out.println(wangwu.introduce());
        List<People> peoplelist = new ArrayList<>();
        peoplelist.add(zhnagsan);
        peoplelist.add(lisi);
        peoplelist.add(0,wangwu);

        Double heighst=0.0;
        for(People a:peoplelist) {
            if (heighst == 0.0) {
                heighst = a.getHeight();
            } else {
                if (heighst < a.getHeight()){
                    heighst=a.getHeight();
                }
            }

        }
        System.out.println(heighst);


        People person=null;
        for(People a:peoplelist){
            if(person==null){
                person=a;
            }
            else{
                if(person.getHeight()<a.getHeight()){
                    person=a;
                }
            }
        }
        System.out.println(person.introduce());
        double sum;
        sum= wangwu.getHeight()+ zhnagsan.getHeight()+ lisi.getHeight();
        double averge=sum/3;
        double higher=person.getHeight()-averge;
        DecimalFormat a = new DecimalFormat("##.000");
        System.out.println("比平均身高高出"+a.format(higher)+"米");


    }
}
